class CalendarDetailsModel {
  int? id;
  String? name;
  String? description;
  String? managerName;
  List<TagName>? tagName;
  List<TagName>? userName;
  String? dateStart;
  String? dateEnd;
  String? state;
  int? taskNums;
  int? progress;
  bool? isFocus;
  int? comments;

  CalendarDetailsModel(
      {this.id,
        this.name,
        this.description,
        this.managerName,
        this.tagName,
        this.userName,
        this.dateStart,
        this.dateEnd,
        this.state,
        this.taskNums,
        this.progress,
        this.isFocus,
        this.comments});

  CalendarDetailsModel.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    name = json['name'];
    description = json['description'];
    managerName = json['manager_name'];
    if (json['tag_name'] != null) {
      tagName = <TagName>[];
      json['tag_name'].forEach((v) {
        tagName!.add(new TagName.fromJson(v));
      });
    }
    if (json['user_name'] != null) {
      userName = <TagName>[];
      json['user_name'].forEach((v) {
        userName!.add(new TagName.fromJson(v));
      });
    }
    dateStart = json['date_start'];
    dateEnd = json['date_end'];
    state = json['state'];
    taskNums = json['task_nums'];
    progress = json['progress'];
    isFocus = json['is_focus'];
    comments = json['comments'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['name'] = this.name;
    data['description'] = this.description;
    data['manager_name'] = this.managerName;
    if (this.tagName != null) {
      data['tag_name'] = this.tagName!.map((v) => v.toJson()).toList();
    }
    if (this.userName != null) {
      data['user_name'] = this.userName!.map((v) => v.toJson()).toList();
    }
    data['date_start'] = this.dateStart;
    data['date_end'] = this.dateEnd;
    data['state'] = this.state;
    data['task_nums'] = this.taskNums;
    data['progress'] = this.progress;
    data['is_focus'] = this.isFocus;
    data['comments'] = this.comments;
    return data;
  }
}

class TagName {
  int? id;
  String? name;

  TagName({this.id, this.name});

  TagName.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    name = json['name'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['name'] = this.name;
    return data;
  }
}
